package com.daily.pump.model;

import android.os.Parcel;
import android.os.Parcelable;

public class Device implements Parcelable {

    /**
     * 设备名称-用户可自命名
     */
    public String deviceName;

    /**
     * 登录用户名称
     */
    public String loginName;

    /**
     * 密码
     */
    public String password;

    /**
     * wifi信息
     */
    public SimpleWifiBean wifiBean;

    /**
     * soft值
     */
    public int softValue;

    /**
     * medium值
     */
    public int mediumValue;

    /**
     * firm值
     */
    public int firmValue;

    public Device() {
        softValue = 30;
        mediumValue = 50;
        firmValue = 75;
    }

    protected Device(Parcel in) {
        deviceName = in.readString();
        loginName = in.readString();
        password = in.readString();
        wifiBean = in.readParcelable(SimpleWifiBean.class.getClassLoader());
        softValue = in.readInt();
        mediumValue = in.readInt();
        firmValue = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(deviceName);
        dest.writeString(loginName);
        dest.writeString(password);
        dest.writeParcelable(wifiBean, flags);
        dest.writeInt(softValue);
        dest.writeInt(mediumValue);
        dest.writeInt(firmValue);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<Device> CREATOR = new Creator<Device>() {
        @Override
        public Device createFromParcel(Parcel in) {
            return new Device(in);
        }

        @Override
        public Device[] newArray(int size) {
            return new Device[size];
        }
    };
}